<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/layout.css" />
<title>Quản lý chuyên mục !</title>
</head>

<body>
<?php include("menu.php"); ?>

<div id="head-noidung">
	<div id="head-main">
	<form name="addcategory" method="get">
	<table class="classtable" style="width:45%;">
	<tbody">
	<tr>
	<td>Tên chuyên mục</td>
	<td><input name="category" type="text" size="35" style="float:left;"></td>
	</tr>
	
	<tr>
	<td>Số thứ tự</td>
	<td><input name="sttcategory" type="text" size="5" style="float:left;"></td>
	</tr>
	
	<tr>
	<td></td>
	<td><input type="submit" name="addcategory" value="Thêm mới" /></td>
	</tr>
	</tbody>
	</table>
	</form>
	
<?php 
include("../include/config.php");
if(isset($_GET['addcategory'])) 
	{ $category=$_GET["category"];
		$sttcategory=$_GET["sttcategory"];	
	
		$SQL ="INSERT INTO category(name,stt,status) VALUES ('".$category."','".$sttcategory."',1)";
		
		$rs=mysql_query($SQL);
		if($rs) {
		echo ("Thêm thành công");
		}
		
		else {
		echo ("Có lỗi");
		}
		
	}
?>	

	</div>	
</div>

<?php include("images/cherry/footer.php"); ?>

</body>
</html>
